#ifndef _INC_NR_EIGEN
#define _INC_NR_EIGEN


//////////////////////////////////////////////////////////////////////////////////////////////////////
//								Chapter 11. Eigensystems											//
//////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////
//	11.1 Jacobi Transformations of a Symmetric Matrix												//
//////////////////////////////////////////////////////////////////////////////////////////////////////
#include "def.h"

int jacobi(double **a, int n, double d[], double **v);
int jacobi33(double a[][3],double d[], double v[][3]);
void eigsrt(double d[], double **v, int n);
void eigsrt(double d[], double v[][SIZE_MAX*DGR], int n);
//////////////////////////////////////////////////////////////////////////////////////////////////////

/*
extern "C" void dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda,
					   double *wr, double *wi,
					   double *vl, int *ldvl, double *vr, int *ldvr,
					   double *work, int *lwork, int *info);
*/
extern "C"  int dgeev_(char *jobvl, char *jobvr, long int *n, double  *
		a, long int *lda, double *wr, double *wi, double *vl,
		long int *ldvl, double *vr, long  int *ldvr, double *work,
		long int *lwork, long int *info);



		

int eigen(double **A,int ndim,double *eigVal,double **eigVec); //using lapack
int eigen(double A[][SIZE_MAX*DGR],int ndim_,double *eigVal,double eigVec[][SIZE_MAX*DGR]);
int eigen33(double A[][3],double *eigVal,double eigVec[][3]); //using lapack , for 3x3 matrix only

#endif
